package myschool.test4;

import myschool.dao.StudentDao;
import myschool.entity.Student;
import myschool.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.text.ParseException;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class TestQuery3 {
    public static void main(String[] args) throws ParseException {

        SqlSession s = MyBatisUtil.get();
        StudentDao mapper = s.getMapper(StudentDao.class);
        List<Student> students = mapper.search(1, 10, "王", null, null, null, null);
        int total = mapper.searchTotal("王", null, null, null, null);
        for (Student stu : students) {
            System.out.println(stu);
        }
        System.out.println(total);
        MyBatisUtil.close(s);
    }
}
